package com.litong.vertx.hello;

import io.vertx.core.Handler;
import io.vertx.core.http.HttpServerRequest;
import io.vertx.core.http.HttpServerResponse;
import io.vertx.core.json.JsonObject;

public class JsonObjectHandler implements Handler<HttpServerRequest> {
  @Override
  public void handle(HttpServerRequest req) {
    HttpServerResponse response = req.response();
    response.putHeader("content-type", "application/json");
    response.end(new JsonObject().put("hello","vert.x!").toString());
  }
}
